<template>
  <!-- 头部导航 -->
  <el-header style="padding: 0;margin: 0">
    <el-affix :offset="0">
      <div id="headDiv">
        <div>
          <el-button type="warning" size="large" style="margin-left: 40px" @click="$router.push('app')" round>
            <el-icon>
              <House/>
            </el-icon>
            首页
          </el-button>
        </div>
        <div>
          <span style="color: #626262;margin-right: 20px">您好!</span>
          <el-button type="primary" size="large" @click="$router.push('shoppingCar')" round>购物车</el-button>
          <el-button size="large" type="primary" @click="$router.push('order')" round>个人订单</el-button>
          <el-button size="large" type="primary" @click="$router.push('user')" round>个人信息</el-button>
          <el-button size="large" type="primary" @click="$router.push('returnOrder')" round>
            退款订单管理
          </el-button>
          <el-button size="large" type="primary" @click="$router.push('userMoney')" round>预存款管理</el-button>
          <el-button size="large" type="danger" style="margin-right: 20px" @click="exitUser()" round>退出登录
          </el-button>
        </div>
      </div>
    </el-affix>
  </el-header>
  <!-- 头部导航end -->

  <!-- 商城logo -->
  <div style="width: 1800px;margin: 0 auto;">
    <div style="font-size: 30px;margin: 20px 0">
      <a href="#" style="color:#545454;text-decoration: none;">LO<span style="color: #c4c4c4">V</span><span>O</span> |
        朗沃商城</a>
    </div>
  </div>
  <!-- 商城logo end -->
</template>

<script>
import {ElMessage} from "element-plus"
import axios from "axios";

export default {
  name: "Demo",
  created() {
    let userToken = sessionStorage.getItem("userToken");
    if (userToken == null) {
      this.$router.push("newLogin");
    } else {
      this.userToken = userToken;
    }
    this.config = {
      headers: {
        'token': this.userToken
      }
    };
    this.loadData();
  },
  methods: {
    // 退出登录
    exitUser() {
      sessionStorage.clear();
      this.$router.push("newLogin")
    }
  }
}
</script>

<style scoped>

</style>